<template>
	<view>
		<scroll-view scroll-y="true" class="scrollContent" :enhanced="true" :bounces="false" :show-scrollbar="false">
			<view>
				<!-- <ss-preview :fileUrl="fileUrl" :fileType="fileType" :imageList="imageList"></ss-preview> -->

				<web-view :src="fileUrl"></web-view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fileUrl: 'http://ww-iots.com:8081/upload/907720243028223016.pdf',
				fileType: '2',
				imageList: [],
			};
		},
		onLoad(opt) {
			if (opt.type == 1) {
				uni.setNavigationBarTitle({
					title: "用户服务协议"
				})
			} else {
				uni.setNavigationBarTitle({
					title: "隐私政策"
				})
			}
			console.log(opt, '*********');
			// this.fileUrl = opt.fileUrl
		},
		methods: {
			//urll为pdf文件网络路径     https://----.pdf
			previewPdf(urll) {
				const that = this
				let url = urll
				uni.showLoading({
					title: '加载中'
				});
				uni.downloadFile({
					url,
					success: ({
						tempFilePath: filePath
					}) => {
						uni.openDocument({
							filePath,
							fail: (err) => {
								console.log('这是打开报错值：' + err)
							},
							complete: () => {
								uni.hideLoading()
							}
						})
					},
					fail: (err) => {
						console.log('这是请求报错：', err)
						uni.hideLoading()
					}
				})
			},

		}
	}
</script>

<style>
	page {
		background-color: #F5F5F5;
	}

	.scrollContent {
		//可视高度，需要在多大的盒子中进行滑动
		height: 100vh;
		width: 100%;
	}

	.about {
		// background-color: #F1F3F5;
		// height: 100vh;
		padding: 28rpx;
		box-sizing: border-box;
	}
</style>